export const getAjaxConfig=({
    method,
    body,
    ...config
}={})=>{
    const type=method.toUpperCase();
    return {
        ...config,
        type,
        data:body,
    }
};
export const ajaxSend=(config,ajax)=>{
    return new Promise((resolve,reject)=>{
        ajax({
            ...getAjaxConfig(config),
            success:resolve,
            error:reject
        });
    });
};

export default ajaxSend;